package com.gopay.common.cps.dao.cbrmb.impl;


import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.gopay.common.base.dao.impl.BaseDAOImpl;
import com.gopay.common.cps.dao.cbrmb.CbrmbApprAssistDAO;
import com.gopay.common.domain.cbrmb.draw.CbrmbApprAssist;


@Repository(value = "cbrmbApprAssistDAO")
public class CbrmbApprAssistDAOImpl extends BaseDAOImpl<CbrmbApprAssist, String> implements CbrmbApprAssistDAO{


    @Override
    public CbrmbApprAssist findByGopayOrderId(String gopayOrderId) {
    	Map<String,Object> params = new HashMap<>();
    	params.put("gopayOrderId", gopayOrderId);
        String hql = " select m from CbrmbApprAssist m where m.gopayOrderId=:gopayOrderId";
        List<CbrmbApprAssist> ss = findByHql(hql,params);
        return (null == ss || 0 == ss.size()) ? null : ss.get(0);
    }
    
    @Override
    public CbrmbApprAssist save(CbrmbApprAssist entity) {
        super.save(entity);
        return entity;
    }

}
